<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>{$setting.site_name}</title>
    <link type="text/css" rel="stylesheet" href="__MOBILE__/css/mobile/bootstrap.min.css">
    <link type="text/css" rel="stylesheet" href="__MOBILE__/css/mobile/font-awesome.min.css">
    <link type="text/css" rel="stylesheet" href="__MOBILE__/css/mobile/layer.css">
    <link type="text/css" rel="stylesheet" href="__MOBILE__/css/mobile/main.css">
    <script type="text/javascript" src="__MOBILE__/js/jquery1.js"></script>
    <script type="text/javascript" src="__MOBILE__/js/mobile/form.min.js"></script>
    <script type="text/javascript" src="__MOBILE__/js/mobile/layer.js"></script>
    <script type="text/javascript" src="__MOBILE__/js/mobile/base.js"></script>
    <!-- <script type="text/javascript" src="__MOBILE__/js/reg.js"></script> -->
<style>
html,body{height:100%;}
body{background:url(__MOBILE__//images/mobile/tg_home_bg.jpg) no-repeat center center fixed; background-size:cover;}
.login-logo{text-align:center; padding-top:50%;; margin:40px 0 20px; position:relative;}
.login-logo img{width:50%;}
.login-form .form-control{background-color:rgba(0,0,0,.4); border:none; color:#fff; font-size:14px;}
.login .login-form .ico{color:#ddd;}
.login-form .btn-primary{ background-color:#0d5f9c; border:none; -moz-box-shadow:0 1px 1px #000; font-size:14px; height:46px;}
.login-form .ft_18{font-size:12px; color:#fff !important;}
.login,.reg{padding-bottom:0;}
.login .con,.reg .con{padding-top:0;}
.login-form .btn-lg{font-size:14px; color:#fff;}
</style>
</head>
<body>
<div class="container-fluid reg">
    <!-- <div class="head">
        <a class="f_l" href="javascript:history.back();" style="width: 30px;font-size: 30px"><i class="icon-angle-left"></i></a>
        <a>账号注册</a>
        <a class="f_r" href="/" style="width: 40px;font-size: 25px"><i class="icon-home"></i></a>
    </div> -->
    <div class="login-logo"><img src="__MOBILE__/images/mobile/l_logo.png" style="position:absolute; top:50%; left:50%; -webkit-transform:translate(-50%,-50%); transform:translate(-50%,-50%);"></div>
    <div class="con login-form">
        <form>
            <ul>
                <li><input id="zcname" name="zcname" type="text" placeholder="用户名(4-10位字符)" minlength="4" maxlength="10" class="form-control input-lg"></li>
                <li><input id="zctel" name="zctel" type="text" placeholder="手机号码" maxlength="11" class="form-control input-lg"></li>
                <li><input id="zcwechat" name="zcwechat" type="text" placeholder="微信号" maxlength="15" class="form-control input-lg"></li>
                <li><input id="passwd" name="passwd" type="password" placeholder="密码(6-20位字符)" minlength="6" maxlength="20" class="form-control input-lg"></li>
                <li><input id="passwdse" name="passwdse" type="password" placeholder="再次输入密码" minlength="6" maxlength="20" class="form-control input-lg"></li>
                <li style="position:relative;"><input id="zcvcode" name="zcvcode" type="text" placeholder="验证码" class="form-control input-lg"><a class="yzm" href="javascript:;" style="position:absolute; top:50%; right:8px; margin-top:-15px;"><img class="verifyimg" src="{:U('Mobile/Register/Verify')}" style="width:80px; height:30px;" alt="none" title="看不清？点击更换一张验证图片"></a></li>
                <li><input name="regBtn" type="button" class="btn btn-primary btn-lg" value="立即注册" onclick="regcheck();"></li>
                <li><a href="{:U('Login/index')}" class="btn btn-lg">已有账号，登陆！</a></li>
            </ul>
        </form>
    </div>
</div>
<!-- <div class="footer abs">
    <ul>
        <li><span>手机版</span> | <a href="http://www.jzz555.com" target="_blank">电脑版</a></li>
        <li>易记域名：www.jzz555.com </li>
        <li>© <?php echo date('Y',time()) ?> {$setting.site_name} 版权所有</li>
    </ul>
</div> -->
<script>
	var verifyimg = $(".verifyimg").attr("src");
	$(".yzm").click(function(){
		if(verifyimg.indexOf('?')>0){
			$(".verifyimg").attr("src",verifyimg+'&random='+Math.random());
		}else{
			$(".verifyimg").attr("src",verifyimg+'?random'+Math.random());
		}
	})

    function regcheck() {
        var name = $("#zcname");
        if(name.val() == "") {
            var e = function() {
                name.focus();
            };
            lay_msg('请输入用户名！', e);
            return false;
        }
    var n_reg = /^[a-zA-Z0-9_]{4,10}$/;
    if(!n_reg.test(name.val())) {
      var e = function() {
                name.focus();
            };
            lay_msg('用户名只能为4-10位的字母数字下划线组合！', e);
            return false;
    }


        var tel=$("#zctel");
        if(tel.val() == "") {
            var e = function() {
                tel.focus();
            };
            lay_msg('请输入手机号码！', e);
            return false;
        }
        var t_reg=/^[1][3-8]\d{9}$/;
        if(!t_reg.test(tel.val())) {
            var e = function() {
                tel.focus();
            };
            lay_msg('请输入正确的手机号码！', e);
            return false;
        }

        var wechat=$("#zcwechat");
        if(wechat.val() == "") {
            var e = function() {
                wechat.focus();
            };
            lay_msg('请输入微信号！', e);
            return false;
        }
        var w_reg=/^[a-zA-Z0-9_]{4,}$/;
        if(!w_reg.test(wechat.val())) {
            var e = function() {
                wechat.focus();
            };
            lay_msg('请输入正确的微信号！', e);
            return false;
        }

        var o_pd = $("#passwd");
        if(o_pd.val() == "") {
            var e = function() {
                o_pd.focus();
            };
            lay_msg('请设置密码！', e);
            return false;
        }
        if(o_pd.val().length < 6) {
            var e = function() {
                o_pd.focus();
            };
            lay_msg('密码至少需要6个字符！', e);
            return false;
        }
        var n_pd = $("#passwdse");
        if(n_pd.val() != o_pd.val()) {
            var e = function() {
                n_pd.focus();
            };
            lay_msg('两次密码输入不一样！', e);
            return false;
        }

        var vcode = $("#zcvcode");
        if(vcode.val() == "") {
            var e = function() {
                vcode.focus();
            };
            lay_msg('请输入验证码！', e);
            return false;
        }
        $.post('registration',{
        	username:name.val(),
        	mobile:tel.val(),
        	wechat:wechat.val(),
        	password:o_pd.val(),
        	code:vcode.val()
        },function(e){
        	if (e.success) {
    			/* $(".step1").removeClass("on");
    			$(".step2").addClass("on");
				dialog.alert1("消息",e.message,null,'/index.php/Index/index'); */
				lay_msg(e.message);
	        	setTimeout(function(){
	        		window.location.href="/index.php/Login/index";
	        	},2000);
			} else {
				/* dialog.error("消息",e.message); */
				lay_msg(e.message);
				var verifyimg = $(".verifyimg").attr("src");
				if(verifyimg.indexOf('?')>0){
					$(".verifyimg").attr("src",verifyimg+'&random='+Math.random());
				}else{
					$(".verifyimg").attr("src",verifyimg+'?random'+Math.random());
				}
			}
        },'json');
   
        
    }
</script>


</body>
</html>